<?php
require_once('../includes/frameworkajax.php');
if(@!$_POST['cd_formapagamento'])
exit;
//echo 123;

$id = $_POST['cd_formapagamento'];
$sql = "select cd_forma_pagamento, nr_dias_prazo, nr_percentual_prazo from tethys.tb_prazo_pagamento
where cd_forma_pagamento = {$id}
order by 2 asc
limit 10";
$query = @Connection::query($sql);
$str = '[';
while($row = $query->fetch()){
	$str .= '{"id":"'.$row['cd_forma_pagamento'].'$'.$row['nr_dias_prazo'].'-'.$row['nr_percentual_prazo'].'","label":"Prazo:'.$row['nr_dias_prazo'].' Parcelas='.$row['nr_percentual_prazo'].'"},';
}
echo substr($str, 0, -1).']';
//echo json_encode($str);
?>